home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Object = "{CF5AF5C7-0AF7-4B49-9CE9-2CD700C0995F}#1.0#0"; "ciaXPPopupMenu.ocx"
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 5310
- ClientLeft = 60
- ClientTop = 450
- ClientWidth = 7245
- LinkTopic = "Form1"
- ScaleHeight = 5310
- ScaleWidth = 7245
- StartUpPosition = 3 'Windows Default
- Begin ciaXPPopupMenu.XPMenu XPMenu1
- Left = 1290
- Top = 4710
- _ExtentX = 847
- _ExtentY = 820
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin VB.CommandButton Command6
- Caption = "change a menu item - chunk method"
- Height = 495
- Left = 2745
- TabIndex = 7
- Top = 2880
- Width = 2000
- End
- Begin VB.CommandButton Command5
- Caption = "change a menu item font bold state"
- Height = 495
- Left = 2745
- TabIndex = 4
- Top = 2340
- Width = 2000
- End
- Begin VB.CommandButton Command4
- Caption = "change a menu item enable state"
- Height = 495
- Left = 2745
- TabIndex = 3
- Top = 660
- Width = 2000
- End
- Begin VB.CommandButton Command3
- Caption = "change a menu item forecolor"
- Height = 495
- Left = 2745
- TabIndex = 2
- Top = 1230
- Width = 2000
- End
- Begin VB.CommandButton Command2
- Caption = "change a menu item caption"
- Height = 495
- Left = 2745
- TabIndex = 1
- Top = 1785
- Width = 2000
- End
- Begin VB.CommandButton Command1
- Caption = "change a menu item check state"
- Height = 495
- Left = 2745
- TabIndex = 0
- Top = 105
- Width = 2000
- End
- Begin MSComctlLib.ImageList ImageList1
- Left = 630
- Top = 4650
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 12
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":0000
- Key = ""
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":055A
- Key = ""
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":0AB4
- Key = ""
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":100E
- Key = ""
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":1568
- Key = ""
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":212A
- Key = ""
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":2684
- Key = ""
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":2BDE
- Key = ""
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":3138
- Key = ""
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":3692
- Key = ""
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":3BEC
- Key = ""
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":4146
- Key = ""
- EndProperty
- EndProperty
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- Caption = "2. Change the font property, including size"
- Height = 195
- Left = 2145
- TabIndex = 6
- Top = 3750
- Width = 3015
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "1. Click anywhere on the form to display the menu"
- Height = 195
- Left = 2145
- TabIndex = 5
- Top = 3480
- Width = 3555
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Type POINTAPI
- X As Long
- Y As Long
- End Type
- Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
- Option Explicit
- Dim Menu1 As XPMenuLib
- Dim subMenu1 As XPMenuLib
- Dim subMenu2 As XPMenuLib
- Dim subMenu3 As XPMenuLib
- Private Sub Command1_Click()
- subMenu1.SetChecked 2, True
- End Sub
- Private Sub Command2_Click()
- Menu1.SetCaption 1, "Change Menu Item"
- End Sub
- Private Sub Command3_Click()
- Menu1.SetForeColor 1, vbBlue
- End Sub
- Private Sub Command4_Click()
- subMenu2.SetEnabled 2, False
- End Sub
- Private Sub Command5_Click()
- subMenu1.SetBold 2, True
- End Sub
- Private Sub Command6_Click()
- Menu1.ChangeItemProperties 4, 3, "Changed Chunk", False, True, True, vbBlue
- End Sub
- Private Sub Form_Load()
- XPMenu1.SetImageList ImageList1
- Set Menu1 = XPMenu1.AddMenu("Menu1")
- Set subMenu1 = XPMenu1.AddMenu("subMenu1")
- Set subMenu2 = XPMenu1.AddMenu("subMenu2")
- Set subMenu3 = XPMenu1.AddMenu("subMenu3")
- With subMenu3
- .AddItem 10, "Toggle Operator Certification", menuTextItem
- .AddItem 0, "Edit Certification Tables", menuTextItem
- .AddItem 9, "View Who's Certified", menuTextItem
- End With
- With subMenu2
- .AddItem 10, "Toggle Security", menuTextItem
- .AddItem 0, "Edit Security Access", menuTextItem
- .AddItem 9, "View Security Log-Ins", menuSubMenu, , , , , , subMenu3
- End With
- With subMenu1
- .AddItem 10, "ISO Document", menuTextItem
- .AddItem 0, "CAD Drawing", menuSubMenu, , , , , , subMenu2
- .AddItem 9, "Historical Database ", menuTextItem
- End With
- With Menu1
- .AddItem 10, "New", menuSubMenu, , , , , , subMenu1
- .AddItem 3, "Open", menuTextItem
- .AddItem 0, "", menuSeperator
- .AddItem 0, "Save", menuTextItem
- .AddItem 0, "Save As", menuTextItem
- .AddItem 0, "", menuSeperator
- .AddItem 1, "Exit", menuTextItem
- End With
- Me.Move (Screen.Width - Me.ScaleWidth) \ 2, (Screen.Height - Me.ScaleHeight) \ 2
- End Sub
- Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim pos As POINTAPI
- GetCursorPos pos
- XPMenu1.ShowMenu "Menu1", pos.X, pos.Y, TopCenter
- End Sub
- Private Sub XPMenu1_Click(menuName As String, itemNum As Integer, itemText As String)
- MsgBox "" & "menu name = " & menuName & ", itemNum = " & itemNum & ", itemText = " & itemText
- End Sub
-